﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="AddNewQuizQuestion.aspx.vb" Inherits="Training.AddNewQuizQuestion" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Training - Training:: Add New Quiz Questions</title>
<link rel="Stylesheet" type="text/css" media="screen" href="../css/adminStyle.css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="ctr">
        <h2>Add New Quiz Question for quiz: 
            <asp:Label ID="lblQuiz" runat="server" Text=""></asp:Label></h2>
        
        <div style="width:350px;text-align:left;margin:0 auto;" class="small">
            This process will take you through selecting a question, the order 
            of the question and selecting answers to associate with this question.
        </div>
        
        <div style="width:500px;text-align:left;margin:0 auto;" class="text">
            <div class="row">
                <div class="full">
                    Selected Question: 
                    <asp:TextBox ID="tbQuestion" CssClass="formfield" Width="25" runat="server"></asp:TextBox>
                     <asp:RequiredFieldValidator ID="rfQuizID" runat="server" 
                        ErrorMessage="required" ControlToValidate="tbQuestion" CssClass="small" 
                        Display="Dynamic"></asp:RequiredFieldValidator>
                        
                    <br />
                    <asp:GridView ID="gvQuestions" runat="server" AutoGenerateColumns="False" 
                        DataKeyNames="QuestionID" DataSourceID="dsQuestions" 
                        EmptyDataText="No questions available" Width="100%">
                        <RowStyle CssClass="row1" />
                        <EmptyDataRowStyle CssClass="row1" />
                        <Columns>
                            <asp:BoundField DataField="QuestionID" HeaderText="ID" InsertVisible="False" 
                                ReadOnly="True" SortExpression="QuestionID">
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Question" HeaderText="Question" 
                                SortExpression="Question">
                            <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                            <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
                            </asp:BoundField>
                            <asp:BoundField DataField="QuestionImage" HeaderText="Image" 
                                SortExpression="QuestionImage">
                            <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                            <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="View Image">
                                <ItemTemplate>
                                    <%#ViewImage(Eval("QuestionImage"))%>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
                            </asp:TemplateField>
                            <asp:HyperLinkField DataNavigateUrlFields="QuestionID" 
                                DataNavigateUrlFormatString="AddNewQuizQuestion.aspx?qsid={0}" 
                                HeaderText="Select" Text="select">
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" />
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
                            </asp:HyperLinkField>
                        </Columns>
                        <HeaderStyle CssClass="rowHead" />
                        <AlternatingRowStyle CssClass="row2" />
                    </asp:GridView>
                </div>
                <div class="clr"></div>
            </div>
            
            <div class="row">
                <div class="full">
                    Question Order: <span class="small">(order by 10's to allow for reordering)</span> 
                     <asp:RequiredFieldValidator ID="rfOrder" runat="server" ErrorMessage="required" 
                        ControlToValidate="tbOrder" CssClass="small" Display="Dynamic"></asp:RequiredFieldValidator><br />
                    <asp:TextBox ID="tbOrder" Width="50" CssClass="formfield" runat="server"></asp:TextBox>
                </div>
                <div class="clr"></div>
            </div>
            
            <div class="row">
                <div class="full">
                    <asp:Button ID="btnContinue" runat="server" CssClass="button" Text="continue" />
                </div>
                <div class="clr"></div>
            </div>
        </div>
        
        <p><b><a href="QuizControl.aspx">Quiz Control</a></b></p>
        <br />
        <p><a href="Default.aspx">Admin Main</a></p>
    </div>
    
    <asp:SqlDataSource ID="dsQuestions" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Conn %>" 
        
        SelectCommand="SELECT [QuestionID], [Question], [QuestionImage] FROM [QuizQuestions]"></asp:SqlDataSource>
    </form>
</body>
</html>
